/*
 * PictureScanActivity.java
 * business
 *
 * Created by ChenTao on 2017/5/16.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.picturescan;

import android.app.Activity;
import android.content.Intent;

import com.yidiandao.business.R;
import com.yidiandao.business.base.BaseActivity;
import com.yidiandao.business.constant.Intents;
import com.yidiandao.business.utils.ActivityUtils;

public class PictureScanActivity extends BaseActivity {

    private PictureScanFragment mFragment;

    public static void actionStart(Activity activity, int position, boolean isShowDeleteBtn) {
        Intent intent = new Intent(activity, PictureScanActivity.class);
        intent.putExtra(Intents.INDEX, position);
        intent.putExtra(Intents.SHOW_DELETE_BTN, isShowDeleteBtn);
        activity.startActivity(intent);
    }

    @Override
    protected void initFragment() {
        mFragment =
                (PictureScanFragment)
                        getSupportFragmentManager().findFragmentById(R.id.container_picture_scan);
        if (mFragment == null) {
            mFragment = PictureScanFragment.getInstance(getIntent().getExtras());
            ActivityUtils.addFragmentToActivity(
                    getSupportFragmentManager(), mFragment, R.id.container_picture_scan);
        }
    }

    @Override
    protected void initPresenter() {
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_picture_scan;
    }
}
